﻿@model Advertisement
<div class="widget-content">
    <div class="widget-box">
        <div class="widget-title">
            <span class="icon"><i class="icon-align-justify"></i></span>
            <h5>编辑广告信息</h5>
        </div>
        <div class="widget-content nopadding">
            @if (IsPost)
            { 
                <div class="widget-content" style="border: 0px">
                    @if (ViewBag.Result)
                    {
                        <div class="alert alert-success">
                            <a class="close" data-dismiss="alert" href="#">×</a>
                            <h4 class="alert-heading">保存成功!</h4>
                            您的广告信息已经成功保存,你可以继续添加或者返回列表查看.
                        </div>
                    }
                    else
                    {
                        <div class="alert alert-error">
                            <a class="close" data-dismiss="alert" href="#">×</a>
                            <h4 class="alert-heading">保存失败!</h4>
                            如确认您的数据填写无误,请联系管理员或查看错误日志.
                        </div>
                    }
                </div>
            }
            <form action="@Url.Action("Info", "Ad", new { id = @Request.QueryString["id"] })" method="post" class="form-horizontal">
                <div class="control-group">
                    <label class="control-label">
                        文件名:</label>
                    <div class="controls">
                        @Html.TextBoxFor(i => i.FileName, new { @class = "span6" })
                        <span class="help-block">请输入广告JS文件的名称，以.js结束</span>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                        内容:</label>
                    <div class="controls">
                        <div class="span6">
                            @Html.TextAreaFor(i => i.Content, new { @class = "xheditor {html5Upload:false,upMultiple:1,upImgUrl:'" + Html.Raw(Url.Action("UpImgAD", "home", new { path = "~/Upload/Ad" })) + "'} textarea_editor span10", rows = "20", style = "height:350px;" })
                            <span class="help-block">请输入广告JS文件的内容</span>
                        </div>
                    </div>
                </div>
                @Html.HiddenFor(i => i.IsRelease)
                <div class="form-actions">
                    <button id="Save" type="submit" class="btn btn-success">
                        @Html.Raw(string.IsNullOrWhiteSpace(Request.QueryString["id"]) ? "确认添加" : "保存编辑")
                    </button>
                    <a href="@Url.Action("Index", "Ad")" class="btn btn-danger">返回列表</a>
                </div>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript" src="@Url.Content("~/Content/xheditor/xheditor-1.1.14-zh-cn.min.js")"></script>